﻿@model Solution.Business.Entities.Advertise

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit", "AdminAdvertise", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Advertise</legend>

        @Html.HiddenFor(model => model.AId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name, "Tên quảng cáo :")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
            <span style="color:red;">*</span>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Image, "Hình ảnh quảng cáo :")
        </div>
        <div class="editor-field">
            <input type="file" name="hinhanh" id="hinhanh" />
            <span style="color:red;">*</span>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Link, "Trang liên kết :")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Link)
            @Html.ValidationMessageFor(model => model.Link)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Position, "Vị trí quảng cáo :")
        </div>
        <div class="editor-field">
        <select id="ViTri" name="ViTri">
	        @if(Model.Position == 1)
         {
		        <option value="0" selected>Logo</option>
		        <option value="1">Banner</option>	
         }
         else
         {	
		        <option value="0">Logo</option>	
		        <option value="1" selected>Banner</option>
	     }
        </select>
            <span style="color:red;">*</span>
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
